package com.gitee.wsl.time.schedule.collection

import com.gitee.wsl.time.schedule.TimeScheduler


@Suppress("NOTHING_TO_INLINE")
inline fun CollectionScheduler.includeAll(kronSchedulers: List<TimeScheduler>) {
    kronSchedulers.forEach {
        include(it)
    }
}

@Suppress("NOTHING_TO_INLINE")
inline fun CollectionScheduler.includeAll(vararg kronSchedulers: TimeScheduler) {
    includeAll(kronSchedulers.toList())
}

operator fun TimeScheduler.plus(kronScheduler: TimeScheduler): CollectionScheduler {
    return CollectionScheduler().apply {
        includeAll(this, kronScheduler)
    }
}

operator fun CollectionScheduler.plusAssign(kronScheduler: TimeScheduler) {
    include(kronScheduler)
}
